<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
$products = $this->getSiblingsProducts();
?>
<div class="siblings-box">
	<div class="head">
		You May Also Like
	</div>
	<ul>
	<?php
	foreach ($products as $_product):
	?>
	<li>
		<div class="product-image">
			<?php
				if(array_key_exists("feature" , $_product->getAttributes())){
					$featured = $_product->getResource()->getAttribute('feature')->getFrontend()->getValue($_product);
				if($featured=='sale') {
					echo '<div class="p-sale"></div>';
				}elseif($featured=='hot') {
					echo '<div class="p-hot"></div>';
				}elseif($featured=='new') {
					echo '<div class="p-new"></div>';
				}elseif($featured=='75%off') {
					echo '<div class="p-75off"></div>';
				}}
			?>
		
			<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(138) ?>" width="138" height="138" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /></a>
		</div>
		<div class="product-shop">
			<?php $simplePricesTax = ($this->helper('tax')->displayPriceIncludingTax() || $this->helper('tax')->displayBothPrices()); ?>
			<?php $_minimalPriceValue = $_product->getMinimalPrice() ?>
			<?php $_minimalPrice = $this->helper('tax')->getPrice($_product, $_minimalPriceValue, $simplePricesTax) ?>
			<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->helper('awmobile')->stripTags($_product->getName(), null, true) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getName(), 'name') ?></a>
			<?php
			if ($_product->getTypeId() == 'bundle'){
				list($_minimalPrice, $_maximalPrice) = $_product->getPriceModel()->getPrices($_product);
				$_price = $_minimalPrice;
			} elseif ($_product->getTypeId() == 'grouped') {     
				$_exclTax = $this->helper('tax')->getPrice($_product, $_minimalPriceValue, $includingTax = null);
				$_inclTax = $this->helper('tax')->getPrice($_product, $_minimalPriceValue, $includingTax = true);                        
				$_price = $_inclTax;
				if (!$this->helper('tax')->displayPriceIncludingTax()) {
					$_price = $_exclTax;
				}                        
			} else {
				$_regularPrice = $_product->getPrice();
				$_price = $_product->getFinalPrice();
			} ?>
			<div class="price-block">
				<?php if($_regularPrice!=$_price): ?>
				<span class="product-regular-price"><?php echo Mage::app()->getStore()->convertPrice( $_regularPrice, true ); ?></span>
				<?php endif; ?>
				<span class="product-price"><?php echo Mage::app()->getStore()->convertPrice( $_price, true ); ?></span>
			</div>
					
			<div style="margin:10px 0 10px;">
				<?php
					$weight2 = $_product->getResource()->getAttribute('weight2')->getFrontend()->getValue($_product);
					$quantity1 = $_product->getResource()->getAttribute('quantity1')->getFrontend()->getValue($_product);
	
					if($weight2!='No')
						echo '<span class="tag-red">'.$weight2.'</span>';
					if($quantity1!='No')
						echo '<span class="tag-green">'.$quantity1.'</span>';
				?>
				
				<?php
					$weight1 = $_product->getResource()->getAttribute('weight1')->getFrontend()->getValue($_product);
					$quantity = $_product->getResource()->getAttribute('quantity')->getFrontend()->getValue($_product);
	
					if($weight1!='No')
						echo '<span class="tag-red">'.$weight1.'</span>';
					if($quantity!='No')
						echo '<span class="tag-green">'.$quantity.'</span>';
				?>
				
			</div>
			
			<?php
				$shipping_time="";
				if(array_key_exists("shipping_time" , $_product->getAttributes())){
					$shipping_time = $_product->getResource()->getAttribute('shipping_time')->getFrontend()->getValue($_product);
				}
			?>
			<?php if($shipping_time==$this->__('Yes')): ?>
			 <div class="shipping_time"></div>
			<?php endif; ?>
		</div>
		<div class="clear"></div>
	</li>
	<?php endforeach; ?>
	</ul>
</div>